package thread;

public class Demo10 {
    public static void main(String[] args) throws InterruptedException {
        //查看线程的所有状态
        //for(Thread.State state : Thread.State.values()){
            //System.out.println(state);
        //}
        Thread t = new Thread(()->{
            while(!Thread.currentThread().isInterrupted()){
                try {
                    Thread.sleep(10000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });

        System.out.println(t.getState());
        t.start();

        //中断t线程
        t.interrupt();

        System.out.println(t.getState());
        t.join();
        System.out.println(t.getState());

    }
}
